<%= form_for messageboard, html: { class: 'thredded--form' } do |f| %>
    <ul class="thredded--form-list">
      <li>
        <%= f.label :name, t('thredded.messageboard.form.title_label') %>
        <%= f.text_field :name, required: true %>
        <%= render 'thredded/shared/field_errors', messages: f.object.errors[:name] %>
      </li>
      <li>
        <%= f.label :description, t('thredded.messageboard.form.description_label') %>
        <%= f.text_field :description %>
      </li>
      <li>
        <%= f.label :messageboard_group_id, t('thredded.messageboard.form.messageboard_group_id_label') %>
        <%= f.collection_select :messageboard_group_id, Thredded::MessageboardGroup.all, :id, :name,
                                include_blank: t('thredded.messageboard.form.no_group') %>
      </li>
      <li>
        <%= f.label :locked do %>
            <%= f.check_box :locked %> <%= t 'thredded.messageboard.form.locked_label' %>
        <% end %>
      </li>

      <li>
        <%= f.submit messageboard.persisted? ? t('thredded.messageboard.update') : t('thredded.messageboard.create'),
                     class: 'thredded--form--submit',
                     'data-disable-with' => messageboard.persisted? ?
                         t('thredded.messageboard.form.update_btn_submitting') :
                         t('thredded.messageboard.form.create_btn_submitting') %>
      </li>
    </ul>
<% end %>
<% if messageboard.persisted? and Thredded.show_messageboard_delete_button %>
  <%= button_to t('thredded.messageboard.form.delete'),
                messageboard_path(messageboard),
                method: 'delete',
                class: 'thredded--messageboard--delete',
                form_class: 'thredded--form',
                data: {confirm: t('thredded.messageboard.form.delete_confirm', messageboard_name: messageboard.name)}%>
<% end %>
